import request from '@/utils/request';

// 提交文档导出申请
export function documentExport(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/document/export/documentExport',
		method: 'post',
		data: data,
		headers: {
			VERSION: 'lishilei',
		},
	});
}

// 查看文档导出申请，服务端处理进程,支持分页查询
export function queryDocumentExportApplications(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/documentExportInfo/list',
		method: 'post',
		data: data,
		headers: {
			VERSION: 'lishilei',
		},
	});
}

// 异步下载文件，(支持下载文件后，删除文件)
export function downloadDoc(fileName: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/document/export/downloadDocs',
		method: 'get',
		responseType: 'blob',
		params: {
			fileName,
		},
		headers: {
			VERSION: 'lishilei',
		},
	});
}

// 清理文档导出申请(要是文档导出申请，正在处理中，则给予提醒，不能清理该请求，需稍后处理)，支持批量删除
export function deleteDocs(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/document/export/deleteDocs',
		method: 'post',
		data: data,
	});
}
